package cn.tedu.project.oa.sys.user.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class PasswordAlterPara {
    // 用户ID校验：非空
    @NotNull(message = "用户ID不能为空")
    @ApiModelProperty(value = "用户ID")
    private Long id;

    @NotNull(message = "密码不能为空")
    @ApiModelProperty(value = "旧密码")
    private String oldPassword;

    @NotNull(message = "密码不能为空")
    @Size(min = 8, max = 20, message = "密码长度必须在8-20位之间")
    @Pattern(
            regexp = "^(?!\\d+$).{8,20}$",
            message = "密码不能是纯数字"
    )
    @ApiModelProperty(value = "新密码")
    private String newPassword;
}
